package controller;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.mongodb.BasicDBObject;
import com.mongodb.DBCollection;
import com.mongodb.DBObject;

import data.Data;

public class CheckBlogServlet extends HttpServlet {
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws IOException {
		response.setContentType("text/html");
		
		String blogurl = request.getParameter("blogurl");
		
		DBCollection collection = Data.data("blogCraw");
		
		DBObject object = collection.findOne(new BasicDBObject("domain",Utils.fomatDmain(blogurl)));
		if(object!=null)
		{
			response.getWriter().println("1");
		}
	}
}
